import { createRouter,createWebHistory } from 'vue-router'
import Layout from '@/Layout/Layout';

export const constantRoutes = [
  {
    path: '',
    component: Layout,
    name: 'IndexLayout',
    redirect: '/index',
    children: [
      {
        path: '/index',
        component: () => import('@/views/index/index'),
        name: 'Index',
        meta: {
          title: '首页',
          icon: 'dashboard',
          type: "-1",
        },
      },
    ]
  },
  {
    path: '',
    component: Layout,
    name: 'RedirectLayout',
    children: [
      {
        path: '/redirect',
        component: () => import('@/views/redirect/index'),
        name: 'Redirect',
        meta: {
          title: '刷新中',
          type: "-1",
        },
      },
    ]
  },
  {
    path: '/404',
    component: () => import('@/views/404/404'),
    name: '404',
    meta: {
      title: process.env.VUE_APP_PRODUCT_NAME,
      type: "-1",
    }
  }
]

// 动态路由，基于用户权限动态去加载
export const dynamicRoutes = [

]

const router = createRouter({
  history: createWebHistory("/"),
  routes: constantRoutes,
})

export default router
